const mysql = require("mysql");
const connection = mysql.createConnection({
    host:"localhost",
    user:"localhost",
    password:"123456",
    database:"mall"
})
connection.connect();
function query(sql){
    return new Promise((resolve, reject) => {
        connection.query(sql,(err,res)=>{
            resolve(res)
            if(err) reject(err)
        })
    })
}
module.exports = query;